/*
 * @Descripttion:
 * @version:
 * @Author: wl
 * @Date: 2020-05-13 13:27:23
 * @LastEditors: wl
 * @LastEditTime: 2020-06-15 13:35:48
 */
import Vue from "vue";
import App from "./App";
import router from "./router";
import api from "./http";
import i18n from "./i18n";
import md5 from "js-md5";
import store from "./store";
import global from "@/config";
import { typePer } from "@/utils/type";
import "@/utils/plugin";
import { format ,formatDate} from "@/utils/datetime";
import ElementUI from "element-ui";
import echarts from "echarts";
import "echarts-liquidfill";
import components from "@/components";
import "element-ui/lib/theme-chalk/index.css";
import "font-awesome/css/font-awesome.min.css";
import checkTimerOut from "@/utils/checkTimerOut";

import errorImg from "@/assets/imgs/houtai/wutu.png";
Vue.prototype.$errorImgUrl = 'this.src="' + errorImg + '"';

Vue.prototype.$md5 = md5;
Vue.use(components);
Vue.use(ElementUI, { size: "small" });
Vue.prototype.$echarts = echarts;
Vue.use(api);

// 点击图片放大
import VueDirectiveImagePreviewer from "vue-directive-image-previewer";
import "vue-directive-image-previewer/dist/assets/style.css";
import tinymce from "tinymce";
import VueTinymce from "@packy-tang/vue-tinymce";
Vue.use(VueDirectiveImagePreviewer, {
  cursor: "pointer",
  clickMethod: "doubleClick",
  zIndex: 9999, //层级显示
  previewSize: 8
});
Vue.prototype.global = global;
Vue.prototype.$format = format;
Vue.prototype.$formatDate = formatDate; //时间格式化的插件


// // 高德地图
import VueAMap from "vue-amap";
Vue.use(VueAMap);
import axios from "axios";
Vue.prototype.$axios = axios;
// 查找类型
Vue.prototype.$typePer = typePer;

// 请求后台接口
import http from "./api/http.js";
import ports from "./api/ports.js";
Vue.prototype.$http = http;
Vue.prototype.$ports = ports;

Vue.prototype.$tinymce = tinymce; // 将全局tinymce对象指向给Vue作用域下
Vue.use(VueTinymce); // 安装vue的tinymce组件
new Vue({
  el: "#app",
  i18n,
  router,
  store,
  render: h => h(App)
});
checkTimerOut();
